<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>门店信息</title>
    <jsp:include page="/WEB-INF/view/commons/css.jsp" />
</head>
<body >
<div id="main-container" class="container-fluid">
    <form  action="biz4sInfoManage/${action eq "create" ?"save":"update"}" name="inputForm" id="inputForm" method="post" class="form-horizontal">
    <input name="id" id="id" value="${entity.id}" type="hidden" />
    <div class="form-group">
        <label class="col-sm-1 control-label">经销商代码：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="code" value="${entity.code}" placeholder="经销商代码">
        </div>
        <label class="col-sm-1 control-label">经销商名称：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="name" value="${entity.name}" placeholder="经销商名称">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">进店时间：</label>
        <div class="col-md-4">
            <input type="text" class="span1 Wdate" style="width:48%" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="implTime" name="implTime" value="${entity.implTimeStr}" placeholder="进店时间" />
        </div>
        <label class="col-sm-1 control-label">服务期：</label>
        <div class="col-md-4">
            <d:select clazz="selectpicker" name="serviceNum" list="${serviceNums}" selected="${entity.serviceNum}"/>
        </div>
    </div>
        <div class="form-group">
        <label class="col-sm-1 control-label">合同期起：</label>
        <div class="col-md-4">
            <input type="text" class="span1 Wdate" style="width:48%" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="serviceBegeintime" name="serviceBegeintime" value="${entity.serviceBegeintimeStr}" placeholder="合同期起" />
        </div>
        <label class="col-sm-1 control-label">合同期止：</label>
        <div class="col-md-4">
            <input type="text" class="span1 Wdate" style="width:48%" onFocus="WdatePicker({dateFmt:'yyyy-MM-dd'})" id="serviceEndintime" name="serviceEndintime" value="${entity.serviceEndintimeStr}" placeholder="合同期止" />
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">进场量：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="dayAmount" value="${entity.dayAmount}" placeholder="进场量">
        </div>
        <label class="col-sm-1 control-label">大区：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="largeArea" value="${entity.largeArea}" placeholder="大区">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">小区：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="area" value="${entity.area}" placeholder="小区">
        </div>
        <label class="col-sm-1 control-label">小组：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="implLeader" value="${entity.implLeader}" placeholder="小组">
        </div>
    </div>
    <div class="form-group">
            <label class="col-sm-1 control-label">组员：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="implMember" value="${entity.implMember}" placeholder="组员">
        </div>
        <label class="col-sm-1 control-label">批次：</label>
        <div class="col-md-4">
            <d:select clazz="selectpicker" name="count" list="${counts}" selected="${entity.count}"/>
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">备注：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="remark" value="${entity.remark}" placeholder="备注">
        </div>
        <label class="col-sm-1 control-label">备注1：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="remark1" value="${entity.remark1}" placeholder="备注1">
        </div>
    </div>
    <div class="form-group">
        <label class="col-sm-1 control-label">备注2：</label>
        <div class="col-md-4">
            <input type="text" class="form-control" name="remark2" value="${entity.remark2}" placeholder="备注2">
        </div>
    </div>
    <div class="form-group">
        <div class="col-sm-offset-1 col-sm-2">
            <button id="saveBtn" type="submit" class="btn btn-sm btn-primary"><i class="fa fa-floppy-o"></i> 提交</button>
            <button type="button" class="btn btn-sm link_close"><i class="fa fa-close"></i> 关闭</button>
        </div>
    </div>
    </form>
</div><!--/#main-container-->

<!-- script start -->
<jsp:include page="/WEB-INF/view/commons/js.jsp" />
<script type="text/javascript">
    $(document).ready(function(e) {
        var options = {
            rules:{
                code : { required : true, maxlength : 7 },
                name : { required : true, maxlength : 50 },
                area : { required : false, maxlength : 100 },
                count : { required : true, maxlength : 2 },
                implTime : { required : true },
                largeArea : { required : false, maxlength : 40 },
                implMember : { required : false, maxlength : 20 },
                implLeader : { required : false, maxlength : 40 },
                serviceNum : { required : true, maxlength : 2 },
                serviceBegeintime : { required : true },
                serviceEndintime : { required : true },
                remark : { required : false, maxlength : 100 },
                remark1 : { required : false },
                remark2 : { required : false }
            },
            submitHandler:function(form){
                $(form).ajaxSubmit({
                    type:'post',
                    dataType:'json',
                    success:function(data){
                        if(data.success){
                            $('#searchBtn', parent.document).click();
                            closeIframe();
                        }else{
                            layer.alert(data.msg);
                        }
                    }
                });
            }
        };
        $("#inputForm").validate(options);
    });
</script>
<!-- script end -->
</body>
</html>
